package qimao.com.edu.entity;

import jakarta.persistence.*;
import java.util.Objects;

/**
 * 管理员表
 * @author 86173
 *
 */
@Entity
@Table(name = "admin")
public class Admin {
	/**
	 * 用户id
	 */
    @Id
    @Column(name = "admin_id", nullable = false)
    private Integer adminId;
    /**
	 * 账号名
	 */
    @Column(name = "username", nullable = false, length = 50, unique = true)
    private String username;
    /**
	 * 密码
	 */
    @Column(name = "password", nullable = false, length = 100)
    private String password;
    /**
	 * 角色
	 */
    @Column(name = "roleName",nullable = false,columnDefinition = "VARCHAR(100) DEFAULT 'author'")
    private String roleName;
    /**
	 * 网名
	 */
    @Column(name = "nickname", nullable = false, length = 50)
    private String nickname;
    
	public Admin() {
		super();
	}

	public Admin(Integer adminId, String username, String password, String roleName, String nickname) {
		super();
		this.adminId = adminId;
		this.username = username;
		this.password = password;
		this.roleName = roleName;
		this.nickname = nickname;
	}

	public Integer getAdminId() {
		return adminId;
	}

	public void setAdminId(Integer adminId) {
		this.adminId = adminId;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	@Override
	public String toString() {
		return "admin [adminId=" + adminId + ", username=" + username + ", password=" + password + ", roleName="
				+ roleName + ", nickname=" + nickname + "]";
	}

}
